package com.xxgc.eow.service.impl;

import com.xxgc.eow.entity.Collectcompany;
import com.xxgc.eow.mapper.CollectcompanyMapper;
import com.xxgc.eow.service.ICollectcompanyService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 * 收藏企业表 服务实现类
 * </p>
 *
 * @author Mr.Abel
 * @since 2023-05-23
 */
@Service
public class CollectcompanyServiceImpl extends ServiceImpl<CollectcompanyMapper, Collectcompany> implements ICollectcompanyService {

    @Resource
    private CollectcompanyMapper collectcompanyMapper;

    @Override
    public List<Collectcompany> getCollectCompaniesByUserId(Integer userId) {
        return collectcompanyMapper.selectByUserId(userId);
    }

    @Override
    public int add(Collectcompany collectcompany) {
        return collectcompanyMapper.insert(collectcompany);
    }

    @Override
    public int updat(Collectcompany collectcompany) {
        return collectcompanyMapper.updateCompanyIdInt(collectcompany);
    }
}
